﻿using System.Web.Optimization;

namespace PortalWeb
{
    public class BundleConfig
    {
        public const string ContentAdminCss = "~/Content/admin/css";
        public const string ContentCss = "~/Content/css";


        public const string BootstrapStylesPath = "~/Content/bootstrap";
        public const string BootstrapThemeStylesPath = "~/Content/bootstrap-theme";
        public const string BootstrapBagStylesPath = "~/Content/bootstrap-bag";
        public const string FontAwesomeStylesPath = "~/Content/fontawesome";

        public const string BootstrapScriptsPath = "~/Scripts/bootstrap";
        public const string BootstrapBagScriptsPath = "~/Scripts/bootstrap-bag";
      
        /// <summary>
        /// Jquery JS
        /// </summary>
        public const string JqueryPath = "~/Scripts/jquery";
        /// <summary>
        /// Jquery Validate JS
        /// </summary>
        public const string JqueryValPath = "~/Scripts/jqueryval";
        public const string SignalRPath = "~/Scripts/jquery/signalr";
        public const string ModernizrPath = "~/Scripts/modernizr";

        public const string RespondScriptsPath = "~/Scripts/respond";
        public const string DocsScriptsPath = "~/Scripts/docs";

        // 有关绑定的详细信息，请访问 http://go.microsoft.com/fwlink/?LinkId=301862
        public static void RegisterBundles(BundleCollection bundles)
        {
            bundles.UseCdn = false;
            BundleTable.EnableOptimizations = true;

            bundles.Add(new ScriptBundle(ModernizrPath)
                .Include("~/PortalWeb.Resource/Scripts/modernizr-*"));

            #region Bootstrap

            bundles.Add(new StyleBundle(BootstrapStylesPath)
                .Include("~/PortalWeb.Resource/Content/bootstrap.css")
                .Include("~/PortalWeb.Resource/Content/bootstrap-theme.css"));

            bundles.Add(new ScriptBundle(BootstrapScriptsPath)
                .Include("~/PortalWeb.Resource/Scripts/bootstrap.js"));

            bundles.Add(new StyleBundle(BootstrapBagStylesPath)
                .Include("~/Content/bootstrap-datepicker.css",
                    "~/PortalWeb.Resource/Content/bootstrap-table.css",
                    "~/PortalWeb.Resource/Content/bootstrap-treeview.css"));


            bundles.Add(new ScriptBundle(BootstrapBagScriptsPath).Include(
                "~/PortalWeb.Resource/Scripts/bootstrap-datepicker.js",
                "~/PortalWeb.Resource/Scripts/locales/bootstrap-datepicker.zh-CN.js",
                "~/PortalWeb.Resource/Scripts/bootstrap-table.js",
                "~/PortalWeb.Resource/Scripts/bootstrap-treeview.js"));

            bundles.Add(new StyleBundle(FontAwesomeStylesPath)
                .Include("~/PortalWeb.Resource/Content/font-awesome.css"));

            #endregion

            #region Jquery

            bundles.Add(new ScriptBundle(JqueryPath)
                .Include("~/PortalWeb.Resource/Scripts/jquery-{version}.js"));

            bundles.Add(new ScriptBundle(JqueryValPath).Include(
                "~/PortalWeb.Resource/Scripts/jquery.validate*"));

            bundles.Add(new ScriptBundle(SignalRPath)
                .Include("~/PortalWeb.Resource/Scripts/jquery.signalR-{version}.js"));
            //respond.js用于为 IE6-8 以及其它不支持 CSS3 Media Queries 的浏览器提供媒体查询的 min-width 和 max-width 特性，实现响应式网页设计（Responsive Web Design）。
            //html5shiv.js:让该死的IE系列支持HTML5吧
            bundles.Add(new ScriptBundle(RespondScriptsPath).Include(
                "~/PortalWeb.Resource/Scripts/respond.js",
                "~/PortalWeb.Resource/Scripts/html5shiv.js"));

            //holder.js:生成缩略图JS ZeroClipboard.js:复制粘贴
            bundles.Add(new ScriptBundle(DocsScriptsPath).Include(
                "~/PortalWeb.Resource/Scripts/holder.js"));

            #endregion

            bundles.Add(new StyleBundle(ContentCss).Include(
                "~/PortalWeb.Resource/Content/style.css",
                "~/PortalWeb.Resource/Content/css.css"));

            bundles.Add(new StyleBundle(ContentAdminCss).Include(
                "~/Areas/Admin/Content/mvpready-admin.css",
                "~/Areas/Admin/Content/style.css",
                "~/Areas/Admin/Content/site-admin.css"));

        }
    }
}
